home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / hypercar / mactool / thinkcgu.sit / TC Prog Guide / card_50052.txt < prev    next >
Encoding:
Text File  |  1991-02-27  |  811 b   |  21 lines

  1. -- card: 50052 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 4755
  5. -- name: 
  6.  
  7.  
  8. -- part contents for background part 4
  9. ----- text -----
  10. COMMA OPERATOR
  11.  
  12. A sequence of expression statements may be rewritten as a single statement, where the individual expressions are separated by the comma operator.  Evaluation is from left to right, and the value of the statement (ignored in this case) is that of the rightmost expression.
  13.  
  14.     temp = i , i = j , j = temp;          /* swap i and j values */
  15.  
  16. As with nested blocks this construct should be used sparingly and with care to avoid obscuring program structure.  The comma operator most often finds use in conjunction with the 'while' and 'for' loops discussed later in this chapter.
  17.  
  18.  
  19. -- part contents for background part 7
  20. ----- text -----
  21. 155